be00bfcdb37d65f5a32a211e0247c28e101b1ef9,DEV/org.openl.spring/src/org/openl/spring/env/PropertySourcesLoader.java,PropertySourcesLoader,load,#MutablePropertySources#Environment#,190

Before Change


            } else {
                log.info("!   The seconds initialization of properties. Does it override the first initialization ? - {}.", localOverride);
                defaultProps = new CompositePropertySource(OPENL_DEFAULT_PROPS);
                propertySources.addBefore(OPENL_INIT_DEFAULT_PROPS, defaultProps);
                applicationProps = new CompositePropertySource(OPENL_APPLICATION_PROPS);
                if (localOverride) {
                    propertySources.addBefore(OPENL_INIT_APPLICATION_PROPS, applicationProps);

After Change


        boolean alreadyInit = true;
        if (propertySources.contains(OPENL_DEFAULT_PROPS)) {
            log.info("The second initialization of properties. Reload previous properties.");
            propertySources.replace(OPENL_DEFAULT_PROPS, defaultProps);
            propertySources.replace(OPENL_APPLICATION_PROPS, applicationProps);
        } else if (!propertySources.contains(OPENL_INIT_PROPS)) {
            alreadyInit = false;
            log.info("The first initialization of properties. Create new.");
            CompositePropertySource initProps = createCompositPropertySource(OPENL_INIT_PROPS);
            propertySources.addLast(initProps);
            addInitProps(initProps);

            propertySources.addAfter(OPENL_INIT_PROPS, defaultProps);
            propertySources.addAfter(OPENL_INIT_PROPS, applicationProps);
        } else if (localOverride) {
            log.info("The first initialization of properties. Override application properties.");
            propertySources.addBefore(OPENL_INIT_DEFAULT_PROPS, defaultProps);
            propertySources.addBefore(OPENL_INIT_APPLICATION_PROPS, applicationProps);
        } else {
            log.info("The first initialization of properties. Append to application properties.");